import request from '@/utils/request'

/**
 * 入驻商城
 * @param {String} phone 手机号
 * @param {String} ltd_level 手机号
 * ltd_level 类型 brand 品牌 brand_level 品牌标识 name 公司名称 verify 验证码 store_img 营业执照 company_cert_img 授权证
 * @returns
 */
export const settled = (data) => {
  return request('/api/user/worker', 'post', data)
}

/**
 * 商户登入
 * @param {String} data
 * @returns
 */
export const loginPwd = (data) => {
  return request('/mch/index/loginPwd', 'post', data)
}

/**
 * 订单列表
 * @param {String} activeState all-全部 cancel-取消 wait_pay-代付款 send-待发货 receive-已发货 completed-已完成 refund-售后
 * @returns
 */
export const getOrderList = (status) => {
  return request('/api/merchant/order_lists', 'get', { activeState: status })
}

/**
 * 发货
 * @param {*} oid 订单id
 * @param {*} logistics_no 物流编号
 * @param {*} no 物流单号
 * @param {*} send_type 物流
 * @returns
 */
// eslint-disable-next-line camelcase
export const sendOrder = (data) => {
  return request('/api/merchant/sendOrder', 'post', data)
}

/**
 * 获取订单详情
 * @param {*} id 订单id
 * @returns
 */
export const orderDetail = (id) => {
  return request('/api/merchant/order_detail', 'get', { id })
}

/**
 * 商铺商品列表
 * @returns
 */
export const goodsLists = (data) => {
  return request('/api/merchant/goods_lists', 'post', data)
}

/**
 * 新增 / 编辑 商品
 * @param {*} data
 * @returns
 */
export const addGoods = (data) => {
  return request('/api/merchant/add', 'post', data)
}

/**
 * 删除商品
 * @param {*} id 商品id
 * @returns
 */
export const delGoods = (id) => {
  return request('/api/merchant/goods_delete', 'post', { id })
}

/**
 * 批量删除
 * @param {*} ids 商品id数据
 * @returns
 */
export const goodsDels = (ids) => {
  return request('/api/merchant/goods_dels', 'post', { ids })
}

/**
 * 全部删除商品
 * @returns
 */
export const goodsAllAels = () => {
  return request('/api/merchant/goods_all_dels', 'post')
}

/**
 * 批量导入模板
 * @returns
 */
export const temp = () => {
  return request('/api/index/import_goods_temp', 'get')
}

/**
 * 未登录时商家详情
 * @param {*} id 店铺
 * @returns
 */
export const shopDetails = (id) => {
  return request('/api/index/merchant_deail', 'get', { id })
}

/**
 *商家详情
 * @returns
 */
export const shopInfo = () => {
  return request('/api/merchant/detail', 'get')
}

/**
 * 未登录时商家详情
 * @param {String} 店铺ID
 * @returns
 */
export const merchantDeail = (id) => {
  return request('/api/index/merchant_deail', 'get', { id })
}

/**
 * 编辑店铺基本信息
 * @param {*} data
 * @returns
 */
export const editShopInfo = (data) => {
  return request('/api/merchant/apply_manager', 'post', data)
}

/**
 * 我的品牌
 * @param {*} page 当前页
 * @param {*} limit 每页数
 * @returns
 */
export const getVendorbrandList = (page, limit) => {
  return request('/api/merchant/merchant_brand_list', 'post', { page, limit })
}

/**
 * 申请品牌
 * @param {*} data 申请品牌
 * @returns
 */
export const examineBrand = (data) => {
  return request('/api/merchant/examine_brand', 'post', data)
}

/**
 * 获取店员列表
 * @returns
 */
export const workerLists = () => {
  return request('/api/merchant/worker_lists', 'get')
}

/**
 * 更新新增员工信息
 * @param {*} data
 * @returns
 */
export const updateWorker = (data) => {
  return request('/api/merchant/update_worker', 'post', data)
}

/**
 * 删除店员
 * @param {*} id
 * @returns
 */
export const managerRemove = (id) => {
  return request('/api/merchant/managerRemove', 'post', { id })
}

/**
 * 修改店员密码
 * @param {*} id 店员id
 * @param {*} password 新密码
 * @returns
 */
export const modInfoWorker = (id, password) => {
  return request('/api/merchant/modInfo_worker', 'post', { id, password })
}

/**
 * 修改商户密码
 */
export const modInfo = (data) => {
  return request('/api/merchant/modInfo', 'post', data)
}

/**
 * 发票信息
 * @returns
 */
export const invoice = () => {
  return request('/api/merchant/invoice', 'get')
}

/**
 * 发票编辑
 * @param {*} data
 * @returns
 */
export const invoiceEdit = (data) => {
  return request('/api/merchant/invoice_edit', 'post', { rise: 2, type: 2, ...data })
}

/**
 * 收货地址
 * @returns
 */
export const addressLists = () => {
  return request('/api/merchant/address_lists', 'get')
}

/**
 * 新增修改地址
 * @param {*} data
 * @returns
 */
export const addressAdd = (data) => {
  return request('/api/merchant/address_add', 'post', data)
}

/**
 * 地址详情
 * @param {*} id 地址ID
 * @returns
 */
export const siteDetails = (id) => {
  return request('/api/merchant/address_info', 'get', { id })
}

/**
 * 删除地址
 * @param {*} id 商品id
 * @returns
 */
export const delAddress = (id) => {
  return request('/api/merchant/address_del', 'post', { id })
}


export default {
	merchantDeail,
	
	
	
	
}